import http from "../plugins/request";

export default {
    // 执行登录
    async login(params) {
        return http.login("/sys/login", params);
    },
    // 图片验证码
    async picCode(params) {
        return http.upload("getCaptcha", params);
    },
    async getAuthMenu(param) {
        return http.get("/getAuthMenu", param);
    },
    async getAuthRouter(param) {
        return http.get("/getAuthRouter", param);
    },
    //分页查询用户列表
     async getUserPage(param) {
        return http.get("/getUserPage", param);
    },
    //部门列表
     async getDeptList(param) {
        return http.get("/getDeptList", param);
    },

    //添加用户
    async addUser(param) {
        return http.post("/addUser", param);
    },

    //修改用户
    async updateUser(param) {
        return http.put("/updateUser", param);
    },
    //分配角色
    async saveUserRole(param) {
        return http.post("/saveUserRole", param);
    },

    //删除用户
    async deleteUser(param) {
        return await http.delete("/deleteUser", param);
    },

    //获取分配角色列表数据
    async getRoleByUser(params) {
        return http.get("/getRoleByUser", params);
    },

    // 导出用户信息
    async exportSysUser(params) {
        return http.post("/system/user/export", params);
    },

    // 上传图片
    async upload(params) {
        return http.upload("/uploadAvatar", params);
    },


}
